/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dingnangen
 */
@Entity
@Table(name = "task_customerdemand")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TaskCustomerdemand.findAll", query = "SELECT t FROM TaskCustomerdemand t"),
    @NamedQuery(name = "TaskCustomerdemand.findByIdtaskCustomerdemand", query = "SELECT t FROM TaskCustomerdemand t WHERE t.idtaskCustomerdemand = :idtaskCustomerdemand"),
    @NamedQuery(name = "TaskCustomerdemand.findByVisiteorder", query = "SELECT t FROM TaskCustomerdemand t WHERE t.visiteorder = :visiteorder"),
    @NamedQuery(name = "TaskCustomerdemand.findByArrivetime", query = "SELECT t FROM TaskCustomerdemand t WHERE t.arrivetime = :arrivetime")})
public class TaskCustomerdemand implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idtask_customerdemand")
    private Integer idtaskCustomerdemand;
    @Column(name = "visiteorder")
    private Integer visiteorder;
    @JSONField (format="HH:mm:ss") 
    @Column(name = "arrivetime")
    @Temporal(TemporalType.TIME)
    private Date arrivetime;
    @JoinColumn(name = "idcustomerdemand", referencedColumnName = "idcustomerdemand")
    @ManyToOne
    private Customerdemand idcustomerdemand;
    @JSONField(label = "extask")
    @JoinColumn(name = "idtask", referencedColumnName = "idtask")
    @ManyToOne
    private Task idtask;

    public TaskCustomerdemand() {
    }

    public TaskCustomerdemand(Integer idtaskCustomerdemand) {
        this.idtaskCustomerdemand = idtaskCustomerdemand;
    }

    public Integer getIdtaskCustomerdemand() {
        return idtaskCustomerdemand;
    }

    public void setIdtaskCustomerdemand(Integer idtaskCustomerdemand) {
        this.idtaskCustomerdemand = idtaskCustomerdemand;
    }

    public Integer getVisiteorder() {
        return visiteorder;
    }

    public void setVisiteorder(Integer visiteorder) {
        this.visiteorder = visiteorder;
    }

    public Date getArrivetime() {
        return arrivetime;
    }

    public void setArrivetime(Date arrivetime) {
        this.arrivetime = arrivetime;
    }

    public Customerdemand getIdcustomerdemand() {
        return idcustomerdemand;
    }

    public void setIdcustomerdemand(Customerdemand idcustomerdemand) {
        this.idcustomerdemand = idcustomerdemand;
    }

    public Task getIdtask() {
        return idtask;
    }

    public void setIdtask(Task idtask) {
        this.idtask = idtask;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtaskCustomerdemand != null ? idtaskCustomerdemand.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TaskCustomerdemand)) {
            return false;
        }
        TaskCustomerdemand other = (TaskCustomerdemand) object;
        if ((this.idtaskCustomerdemand == null && other.idtaskCustomerdemand != null) || (this.idtaskCustomerdemand != null && !this.idtaskCustomerdemand.equals(other.idtaskCustomerdemand))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.entity.TaskCustomerdemand[ idtaskCustomerdemand=" + idtaskCustomerdemand + " ]";
    }
    
}
